<template>
  <div id="operationRemove">
    <Breadcrumb content="批次删除" v-if="showBreadCrumbTag === true" />
    <GoBack :content="'批次删除'" v-if="showBreadCrumbTag === false" @closeDrawer="closeDrawer" :backUrl="url"></GoBack>
    <div class="bodyContent">
      <Splitpanes>
        <!-- 查询条件 -->
        <Pane size="17">
          <el-scrollbar style="height: 100%">
            <vxe-form ref="searchConForm" :data="form" :rules="formRules" title-width="90"
              class-name="padding-xs width-100-percentage">
              <vxe-form-item title="报告单元" class-name="width-100-percentage">
                <template #default>
                  <SelectWorkGroupAllDefaultAll ref="selectWorkGroupRef" :url="'/api/rptGroup/findRptGroup'"
                    :inputWidth="'100%'" @fatherMethod="searchWklt" :isShowAll="true" :isClear="true">
                  </SelectWorkGroupAllDefaultAll>
                </template>
              </vxe-form-item>
              <vxe-form-item title="检验日期" class-name="width-100-percentage">
                <template #default="{ data }">
                  <el-date-picker v-model="data.sampleda" :value-format="'YYYY-MM-DD HH:mm:ss'" type="datetime"
                    placeholder="检验日期[起]" :shortcuts="shortcuts" style="width: 100%" />
                </template>
              </vxe-form-item>
              <vxe-form-item title="标本号范围" class-name="width-100-percentage">
                <template #default="{ data }">
                  <vxe-input class="enterNextInputFlag" type="text" v-model="data.sampleNo" placeholder="请输入1,2,5-8等格式"
                    clearable class-name="width-100-percentage"></vxe-input>
                </template>
              </vxe-form-item>
              <vxe-form-item title="条码号" class-name="width-100-percentage">
                <template #default="{ data }">
                  <vxe-input v-enterNextInput class="enterNextInputFlag" type="text" v-model="data.reqNo"
                    placeholder="条码号" clearable class-name="width-100-percentage"></vxe-input>
                </template>
              </vxe-form-item>
              <!-- <vxe-form-item title="病历号" class-name="width-100-percentage">
                <template #default="{ data }">
                  <vxe-input v-enterNextInput class="enterNextInputFlag" type="text" v-model="data.patNo" placeholder="病历号" clearable class-name="width-100-percentage" @blur="handleSearch"></vxe-input>
                </template>
              </vxe-form-item>
              <vxe-form-item title="姓名" class-name="width-100-percentage">
                <template #default="{ data }">
                  <vxe-input v-enterNextInput class="enterNextInputFlag" type="text" v-model="data.patNa" placeholder="姓名" clearable class-name="width-100-percentage" @blur="handleSearch"></vxe-input>
                </template>
              </vxe-form-item>
              <vxe-form-item title="性别" class-name="width-100-percentage">
                <template #default="{ data }">
                  <VxeDictSelection v-enterNextInput class="enterNextInputFlag" :url="'/api/sys/basDictDetail/findDictDetailList'" @confirmClick="dropSelectConfirm" :displayTexts="['name']" :displayTextObj="data.sex" :tableColumn="[{ field: 'code', title: '编码', width: `60px` }, { field: 'name', title: '名称', minWidth: `80px` }]" :aimKeys="[{ aimKey: 'sex', rowKey: 'code' }]" :dataObj="{ code: 'sex' }" />
                </template>
              </vxe-form-item> -->
              <vxe-form-item title="科室" class-name="width-100-percentage">
                <VxePulldownSelection v-enterNextInput :url="'/api/sys/findDepartmentListbyCurrentUserOrg'"
                  @confirmClick="dropPullDownConfirm"
                  :tableColumn="[{ field: 'code', title: '编码', width: '60px' }, { field: 'name', title: '名称' }]"
                  :aimKeys="[{ aimKey: 'reqDept', rowKey: 'code' }, { aimKey: 'reqDeptNa', rowKey: 'name' }]"
                  :displayTexts="['name']" :displayTextObj="form.reqDept ? form.reqDept : ''" />
              </vxe-form-item>

              <vxe-form-item title="有病人姓名不删除" class-name="width-100-percentage">
                <template #title>
                  <vxe-checkbox content="有病人姓名不删除" v-model="form.isFilterPatNa" @change="handleSearch"></vxe-checkbox>
                </template>
              </vxe-form-item>

              <vxe-form-item title="有检验结果不删除" class-name="width-100-percentage">
                <template #title>
                  <vxe-checkbox content="有检验结果不删除" v-model="form.isFilterResult" @change="handleSearch"></vxe-checkbox>
                </template>
              </vxe-form-item>

              <vxe-form-item title="" class-name="width-100-percentage">
                <template #title>
                  <vxe-radio-group v-model="form.radio" class="margin-top cu-list">
                    <div class="cu-item readio-item">
                      <vxe-radio label="1">只删除结果</vxe-radio><br />
                    </div>
                    <div class="cu-item readio-item">
                      <vxe-radio label="2">删除病人信息+结果</vxe-radio><br />
                    </div>
                  </vxe-radio-group>
                </template>
              </vxe-form-item>

              <!-- <vxe-radio-group v-model="radio" class="margin-top cu-list">
                <vxe-form-item title="只删除结果" class-name="width-100-percentage">
                  <template #title>
                    <vxe-radio :label="1" content="只删除结果"></vxe-radio>
                  </template>
                </vxe-form-item>

                <vxe-form-item title="删除病人信息+结果" class-name="width-100-percentage">
                  <template #title>
                    <vxe-radio :label="2" content="删除病人信息+结果"></vxe-radio>
                  </template>
                </vxe-form-item>
              </vxe-radio-group> -->

              <vxe-form-item title-width="0" class-name="width-100-percentage">
                <template #title></template>
                <template #default>
                  <div class="width-100-percentage flex justify-center">
                    <vxe-button type="text" content="重置条件" class="button-blue" @click="resetForm"></vxe-button>
                    <!-- <vxe-button type="text" content="查询数据" class="button-blue" @click="handleSearch" icon="el-icon-search"></vxe-button> -->
                  </div>
                </template>
              </vxe-form-item>
            </vxe-form>
          </el-scrollbar>
        </Pane>
        <Pane size="83">
          <Splitpanes>
            <Pane size="60">
              <vxe-toolbar perfect>
                <template #buttons>
                  <vxe-button type="text" class="button-blue" icon="vxe-icon-search" content="查询"
                    @click="handleSearch"></vxe-button>
                  <vxe-button type="text" class="button-red" icon="vxe-icon-delete" content="删除"
                    @click="deleteRows"></vxe-button>
                </template>
              </vxe-toolbar>
              <vxe-table :loading="tableLoading" border align="left" show-overflow ref="wLTable" class="mytable-scrollbar"
                height="95%" :data="mainInfoList" :keyboard-config="{ isArrow: true }" :sort-config="{ trigger: 'cell' }"
                :row-config="{ isCurrent: true, isHover: true }" :cell-class-name="cellClassName"
                :column-config="{ resizable: true }" :scroll-y="{ enabled: true }" @current-change="handleRowClick">
                <vxe-column type="checkbox" width="26"></vxe-column>
                <vxe-column type="seq" title="#" width="30"></vxe-column>
                <vxe-column field="rptGroup" title="报告单元" width="110" show-overflow></vxe-column>
                <vxe-column field="sampleda" title="检验日期" show-overflow>
                  <template #default="{ row }">
                    <span>
                      {{
                        row.sampleda ? formatDateTime(new Date(row.sampleda), 'yyyy-MM-dd') : ''
                      }}
                    </span>
                  </template>
                </vxe-column>
                <vxe-column field="patNa" title="姓名" width="70">
                  <template #default="{ row }">
                    <span :style="{ color: row.displayColor }">{{ row.patNa }}</span>
                  </template>
                </vxe-column>
                <vxe-column field="sex" title="性别" width="35" show-overflow>
                  <template #default="{ row }">{{ row.sex === '1' ? '男' : row.sex === '2' ? '女' : '未知' }}</template>
                </vxe-column>
                <vxe-column field="age" title="年龄" width="50" show-overflow></vxe-column>
                <vxe-column field="bedNo" title="病床" width="50" show-overflow></vxe-column>
                <vxe-column field="patNo" title="病历号" width="128">
                  <template #default="{ row }">
                    <span :style="{ color: row.displayColor }">{{ row.patNo }}</span>
                  </template>
                </vxe-column>
                <vxe-column field="reqPurpose" title="申请目的" show-overflow></vxe-column>
                <vxe-column field="sampleTypeNa" title="样本类型" min-width="100" show-overflow></vxe-column>
                <vxe-column field="reqDeptNa" title="科室" width="70" show-overflow></vxe-column>
                <vxe-column field="reqNo" title="条码号" width="90">
                  <template #default="{ row }">
                    <span :style="{ color: row.displayColor }">{{ row.reqNo }}</span>
                  </template>
                </vxe-column>
                <vxe-column field="patType" title="病人类型">
                  <template #default="{ row }">
                    <span>{{ row.patTypeNa }}</span>
                  </template>
                </vxe-column>
                <vxe-column field="sampleNo" title="标本号">
                  <template #default="{ row }">
                    <span :style="{ color: row.displayColor }">{{ row.sampleNo }}</span>
                  </template>
                </vxe-column>
                <vxe-column field="testTime" title="上机时间">
                  <template #default="{ row }">
                    <span :style="{ color: row.displayColor }">
                      {{
                        row.testTime ? formatDateTime(new Date(row.testTime), 'yyyy-MM-dd') : ''
                      }}
                    </span>
                  </template>
                </vxe-column>
              </vxe-table>
            </Pane>
            <!-- <Pane size="40">
                  <div style="height: 100%" v-if="resultType === 1">
                    <vxe-table ref="wLTableResult" :border="'inner'" :scroll-y="{ enabled: true ,gt: 100}" class="border-top solid mytable-scrollbar" v-loading="Resultloading" resizable show-overflow :mouse-config="{ selected: !currentWork.isFirstReviewed }" height="95%" :data="wLResults" :row-config="{ isArrow: true, isEnter: true, isCurrent: true }" :keyboard-config="{ isArrow: true }" :tooltip-config="{ showAll: true, enterable: true }" :cell-style="calcCellBgColor">
                      <vxe-column type="seq" width="24"></vxe-column>
                      <vxe-column field="itemNo" title="项目名称" width="160" show-overflow>
                        <template #default="{ row }">
                          <span>{{ row.itemNo + ' ' + row.itemNa }}</span>
                        </template>
                      </vxe-column>
                      <vxe-column field="testResult" title="检验结果" show-overflow></vxe-column>
                      <vxe-column field="resultFlag" title="序号" width="30">
                        <template #default="{ row }">
                          <span class="padding-lr-xs text-df">{{ getResultFlag(row.resultFlag) }}</span>
                          <span class="padding-lr-xs" v-if="row.isAlarm === '1' || row.isAlarm === 1">{{ row.alarmText }}</span>
                        </template>
                      </vxe-column>
                      <vxe-column field="ref" title="参考范围"></vxe-column>
                      <vxe-column field="resultDesc" title="结果说明"></vxe-column>
                      <vxe-column field="instrNa" title="仪器名称"></vxe-column>
                      <vxe-column field="rawData" title="仪器原始结果"></vxe-column>
                    </vxe-table>
                  </div>
                  <OrgResultComp ref="orgResultCompRef" :isChildren="true" v-if="resultType === 2" />
                </Pane> -->
          </Splitpanes>
        </Pane>
      </Splitpanes>
      <!-- <MultiRptPreview :reportList="reportList" :toggle="isPreviewRpt" :modalTitle="'报告预览'" /> -->
      <!-- 静默打印 -->
      <!-- <QuietPrint ref="quietPrintRef" :printParams="printParamsObj" /> -->
    </div>
  </div>
</template>
<script lang="ts" setup>
import Breadcrumb from '@/components/Breadcrumb.vue'; //面包屑
import GoBack from '@/components/GoBack.vue'; //返回组件
import { reactive, ref, getCurrentInstance, onMounted, watch } from 'vue';
import { IsEmpty, formatDateTime, sortByField } from '@/utils/common';
import { Splitpanes, Pane } from 'splitpanes';
import 'splitpanes/dist/splitpanes.css';
import { VXETable, VxeFormPropTypes, VxeButtonEvents } from 'vxe-table';
import { VxeMessage, VxeNotifyType } from '@/utils/CommonMessage';
import VxePulldownSelection from '@/components/VxePulldownSelection.vue';
import * as XLSX from 'xlsx';
import SelectWorkGroup from '../lab_bus/components/SelectWorkGroup.vue'; //报告单元引入下拉组件
import SelectWorkGroupAllDefaultAll from '../lab_bus/components/SelectWorkGroupAllDefaultAll.vue'; //报告单元默认全部引入下拉组件
import OrgResultComp from '../lab_bus/components/OrgResultComp.vue'; //
import { AppStore } from '@/stores/store';
import { getOptionValueByCodeGlobalOption, getOptionValueByCodeRptGroupOption } from '@/utils/SysOptionsHelper';
import axios from 'axios';

let selectWorkGroupRef = ref(null);
let store = AppStore();
let { proxy }: any = getCurrentInstance();
let Floading = ref(false);
let Wloading = ref(false);
let tableLoading = ref(false);
let wLResults = reactive([]); //工作列表结果
let resultType = ref(1); //结果类型.1普通/2细菌
let activeName = ref('reportTab');
let loading = ref(false);
let Resultloading = ref(false);
const Axios = axios.create();
let wT = reactive({
  id: null,
  name: ''
});
let mainInfoList = reactive([]); //报告单元列表数据
let sexList: any = reactive([]); //字典表：性别
let chkStatusList: any = reactive([]); //字典表：审核状态
let patTypeList: any = reactive([]); //字典表：病人类型
const isPreviewRpt = ref(false);
const quietPrintRef = ref(null); //静默打印组件
const orgResultCompRef = ref(null); //细菌组件
let printParamsObj = ref(null);
let reportList = reactive([]);
const wLTable = ref(null); /**报告单表格对象 */
let deptOptions: any = reactive([]); //选择框

let formData = reactive({});

const maininfoRef = ref(null);


const shortcuts = [
  {
    text: '今天',
    value: new Date()
  },
  {
    text: '昨天',
    value: () => {
      const date = new Date();
      date.setDate(date.getDate() - 1);
      return date;
    }
  },
  {
    text: '一周前',
    value: () => {
      const date = new Date();
      date.setDate(date.getDate() - 7);
      return date;
    }
  }
];
//#region  自定义指令
// 自定义指令
const enterNextInput: ObjectDirective<HTMLElement> = {
  mounted(el) {
    el.addEventListener('keypress', (e) => {
      let charcode = typeof e.charCode == 'number' ? e.charCode : e.keyCode;
      if (charcode == 13) {
        const doms: any = document.getElementsByClassName('enterNextInputFlag');
        let list = [];
        for (let i = 0; i < doms.length; i++) {
          let node = doms[i].childNodes;
          if (node.length > 0) {
            node.forEach((v) => {
              if ((v.nodeName == 'TEXTAREA' || v.nodeName == 'INPUT') && !v.disabled) {
                list.push(v);
              }
            });
          }
        }
        for (let j = 0; j <= list.length; j++) {
          if (list[j] == document.activeElement) {
            if (j == list.length - 1) {
              return;
            }
            list[j + 1].focus();
            return;
          }
        }
      }
    });
  }
};

// 使用自定义指令
proxy.$.directives = { enterNextInput: enterNextInput };

let form = reactive({
  rptGroup: '',
  sampleda: null,
  reqNo: '',
  sampleNo: '', //标本号
  reqDept: '', //科室//userInfo.employee.defaultAuthorizeDepId
  isFilterPatNa: false, //是否过滤病人姓名
  isFilterResult: false, //是否过滤结果
  radio: '2',
});

// 表单校验规则
const formRules = reactive<VxeFormPropTypes.Rules>({
  sampleNo: [{ required: true, message: '请输入标本号' }],
});

let reportDay = ref(0);
let currentWork = reactive({}) as any;

defineExpose({ initPage, init });

let showBreadCrumbTag = ref(true); //当为true时显示的是普通面包屑 false显示的是返回组件
let url = ref(''); //抽屉要返回的路由地址

function init(row: any, row2: any) {
  url.value = row;
  showBreadCrumbTag.value = !row2;
}
// 关闭抽屉
function closeDrawer() {
  showBreadCrumbTag.value = true; //恢复成面包屑
  proxy.$emit('closeDrawer');
}


// 页面加载时字典
onMounted(() => {
  // reportDay.value = getOptionValueByCodeGlobalOption('bgcxmrrqfw') ? getOptionValueByCodeGlobalOption('bgcxmrrqfw') : 0;
  form.sampleda = formatDateTime(new Date().valueOf() - reportDay.value * 24 * 60 * 60 * 1000, 'yyyy-MM-dd 00:00:00');
  getDictSexList(); //加载性别字典
  getDepyOptions(); //获取科室
  getDictPatTypeList(); //病人类型

});

function initPage(row: any) {
  form.sampleda = formatDateTime(new Date().valueOf() - 180 * 24 * 60 * 60 * 1000, 'yyyy-MM-dd 00:00:00');
}
// 获取所有部门选项(下拉框)
function getDepyOptions() {
  const url = '/api/sys/findDepartmentList';
  proxy.$http
    .get(url, { params: { orgId: store.userInfo.orgId } })
    .then((res: any) => {
      deptOptions.push(...res.data.deptList);
    })
    .catch((err: any) => {
      VxeMessage('获取所有部门选项(下拉框)失败', VxeNotifyType.error);
    });
}


//获取性别数据字典
function getDictSexList() {
  sexList.length = 0;
  const url = '/api/sys/basDictDetail/findDictDetailList';
  proxy.$http
    .get(url, { params: { code: 'SEX' } })
    .then((res: any) => {
      sexList.push(...res.data);
    })
    .catch((err: any) => {
      proxy.$alert(err, '提示');
    });
}

/**下拉选中 */
function dropSelectConfirm(e) {
  e.aimKeys.forEach((m) => {
    form[m.aimKey] = e.row[m.rowKey];
  });
  handleSearch();
}

/**下拉选中 */
function dropPullDownConfirm(e) {
  e.aimKeys.forEach((m) => {
    form[m.aimKey] = e.row[m.rowKey];
  });
  // handleSearch();
}

//获取病人类型
function getDictPatTypeList() {
  patTypeList.length = 0;
  const url = '/api/sys/basDictDetail/findDictDetailList';
  proxy.$http
    .get(url, { params: { code: 'PATTYPE' } })
    .then((res: any) => {
      patTypeList.push(...res.data);
    })
    .catch((err: any) => {
      proxy.$alert(err, '提示');
    });
}

// 查询
function handleSearch() {
  if (form.sampleNo == '') {
    proxy.$alert('标本号不能为空', '提示');
    return;
  }
  searchLabMaininfoList(); //查询信息
}

function deleteRows() {
  const arr = (proxy.$refs.wLTable as any).getCheckboxRecords(); //获取选中行
  if (!(arr && arr.length > 0 && arr[0])) {
    VxeMessage('请勾选要删除的数据', VxeNotifyType.info);
  } else {
    proxy
      .$confirm('确定要删除当前勾选的数据？', '提示', {
        cancelButtonClass: 'cancel-button',
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
      .then(() => {
        const data = { labMaininfoList: arr, radio: form.radio };
        const url = '/lab/maininfo/removeLabMaininfoList';
        proxy.$http
          .post(url, data)
          .then((res: any) => {
            VxeMessage(res.status.msg, VxeNotifyType.success);
            handleSearch();
          })
          .catch((err: any) => {
            VxeMessage(err, VxeNotifyType.error);
          });
      })
      .catch((err: any) => {
        VxeMessage(err, VxeNotifyType.error);
      });
  }
}

function searchLabMaininfoList() {
  mainInfoList.length = 0;
  VXETable.modal.message({
    id: 'myMsgLoading',
    content: '加载中,请稍后...',
    status: 'loading',
    duration: -1
  });
  const url = '/lab/maininfo/searchLabMaininfoList';
  let data: any = Object.assign({}, form);
  proxy.$http
    .post(url, data)
    .then((res: any) => {
      if (res.data.length > 0) {
        proxy.$nextTick(() => {
          mainInfoList.push(...res.data);
          //handleRowClick({ row: res.data[0] });
          proxy.$nextTick(() => {
            const $xTable = proxy.$refs.wLTable as any;

            $xTable.setCheckboxRow(mainInfoList, true);

          });
        });
      }
      Wloading.value = false;
      VXETable.modal.close('myMsgLoading');
    })
    .catch((err) => {
      VXETable.modal.close('myMsgLoading');
      Wloading.value = false;
      VxeMessage(err, VxeNotifyType.error);
    });
}


//获取工作列表
function searchWklt(selectedRadioId, selectedName) {
  form.rptGroup = selectedRadioId.value;
}

//rowClick
// function handleRowClick({ row }) {
//   wLResults.length = 0;
//   resultType.value = 1;

//   if (IsEmpty(row)) {
//     wLResults = [];
//     return;
//   }
//   if (row.businessType === '20') {
//       //判断是细菌的报告单元
//       resultType.value = 2;
//       (proxy.$refs.wLTable as any).setCurrentRow(row);
//       //进行组件查询
//       proxy.$nextTick(() => {
//       //进行组件查询
//       orgResultCompRef.value.initPage(row); //调用菜单组件方法
//        });
//     } else {
//       (proxy.$refs.wLTable as any).setCurrentRow(row);
//       proxy.$emit('RowClick', row);
//       Resultloading.value = true;
//       const data={
//         rptGroup: row.rptGroup,
//         sampleda: row.sampleda +' 00:00:00',
//         sampleNo: row.sampleNo
//       }
//     let url='';
//     if (form.isFilterResult){
//       url= 'lab/maininfo/findHisStoryRptResultByLabMaininfo';
//       proxy.$http
//           .get(url, { params: data })
//           .then((res: any) => {
//             wLResults.length = 0;
//             //wLResults.push(...res.data);
//             wLResults.push(...sortByField(res.data, 'displayOrder', 'asc'));

//             Resultloading.value = false;
//           })
//           .catch((err) => {
//             Resultloading.value = false;
//             VxeMessage(err, VxeNotifyType.error);
//           });
//     }else {
//       url = 'lab/maininfo/findRptResultByLabMaininfo?id=' + row.id;
//       proxy.$http
//           .get(url)
//           .then((res: any) => {
//             wLResults.length = 0;
//             //wLResults.push(...res.data);
//             wLResults.push(...sortByField(res.data, 'displayOrder', 'asc'));

//             Resultloading.value = false;
//           })
//           .catch((err) => {
//             Resultloading.value = false;
//             VxeMessage(err, VxeNotifyType.error);
//           });
//     }

//     }
//     Object.assign(formData, row);
//     Object.assign(currentWork, row);
// }

//?单元格背景色
function cellClassName({ row, rowIndex, column, columnIndex }) {
  if (column.property === 'isUrgent') {
    if (row.isUrgent === 1) {
      return 'bg-violet';
    } else {
      return '';
    }
  }
  if (column.property === 'isChk') {
    if (row.isChk === 2 || row.isChk === 1) {
      return 'bg-brilliantGreen';
    } else {
      return '';
    }
  }
  if (column.property === 'isAlarm') {
    if (row.isAlarm === 1) {
      return 'bg-brilliantRed';
    } else {
      return '';
    }
  }
  if (column.property === 'isAutoPrint') {
    if (row.isAutoPrint === 1) {
      return 'bg-darkBlue';
    } else {
      return '';
    }
  }
  if (column.property === 'isPrint') {
    if (row.isPrint === 1) {
      return 'bg-brilliantBlue';
    } else {
      return '';
    }
  }
}
//#endregion

function resetForm() {
  form.rptGroup = '';
  form.sampleda = formatDateTime(new Date().valueOf() - reportDay.value * 24 * 60 * 60 * 1000, 'yyyy-MM-dd 00:00:00');
  form.reqNo = '';
  form.sampleNo = '';
  form.reqDept = '';
  form.radio = '2';
  form.isFilterPatNa = false; //是否过滤病人姓名
  form.isFilterResult = false; //是否过滤结果
  selectWorkGroupRef.value?.resetSelectedVal(); //重置选中的工作组
}

</script>
<style lang="scss" scoped>
#operationRemove {
  height: 100%;

  .bodyContent {
    height: calc(100% - 60px);

    :deep(.el-tabs__header) {
      margin: 0 !important;
    }

    :deep(.el-tabs) {
      height: 100%;

      .el-tabs__content {
        height: calc(100% - 41px);
      }
    }
  }

  .splitpanes {
    background-color: $base-white;
    height: 100%;
  }

  :deep(.splitpanes__pane) {
    overflow: visible;
  }

  :deep(.el-table) {

    th,
    .cell {
      padding: 2px 0;
      font-size: 14px;
    }

    td {
      padding: 0;
    }

    .cell.el-tooltip {
      min-width: 0;
      padding: 0 2px;

      // 急诊
      .el-icon-first-aid-kit {
        color: $danger-color;
      }

      // 打印
      .el-icon-printer {
        color: $warning-color;
      }

      // 审核
      .el-icon-coordinate {
        color: $brand-color;
      }

      // 完成
      .el-icon-circle-check {
        color: $success-color;
      }

      // 危急
      .el-icon-warning {
        color: $danger-color;
      }
    }

    .table-icon .cell.el-tooltip {
      padding: 0;

      i {
        font-size: 12px;
        font-weight: 700;
      }
    }

    .ultra-small-font {
      font-weight: 500;
      font-size: 12px;
      line-height: 12px;
      transform: scale(0.9);
    }
  }

  :deep(.vxe-cell) {
    padding-left: 5px;
  }

  // 附加按钮间距
  .button-blue,
  .button-red {
    margin: 0 5px 0 0;
  }
}
</style>
